package com.ruoyi.user.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.user.mapper.UserConsumeDetailMapper;
import com.ruoyi.user.domain.UserConsumeDetail;
import com.ruoyi.user.service.IUserConsumeDetailService;

/**
 * 消费记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-04-10
 */
@Service
public class UserConsumeDetailServiceImpl implements IUserConsumeDetailService 
{
    @Autowired
    private UserConsumeDetailMapper userConsumeDetailMapper;

    /**
     * 查询消费记录
     * 
     * @param id 消费记录主键
     * @return 消费记录
     */
    @Override
    public UserConsumeDetail selectUserConsumeDetailById(Long id)
    {
        return userConsumeDetailMapper.selectUserConsumeDetailById(id);
    }

    /**
     * 查询消费记录列表
     * 
     * @param userConsumeDetail 消费记录
     * @return 消费记录
     */
    @Override
    public List<UserConsumeDetail> selectUserConsumeDetailList(UserConsumeDetail userConsumeDetail)
    {
        return userConsumeDetailMapper.selectUserConsumeDetailList(userConsumeDetail);
    }

    /**
     * 新增消费记录
     * 
     * @param userConsumeDetail 消费记录
     * @return 结果
     */
    @Override
    public int insertUserConsumeDetail(UserConsumeDetail userConsumeDetail)
    {
        userConsumeDetail.setCreateTime(DateUtils.getNowDate());
        return userConsumeDetailMapper.insertUserConsumeDetail(userConsumeDetail);
    }

    /**
     * 修改消费记录
     * 
     * @param userConsumeDetail 消费记录
     * @return 结果
     */
    @Override
    public int updateUserConsumeDetail(UserConsumeDetail userConsumeDetail)
    {
        userConsumeDetail.setUpdateTime(DateUtils.getNowDate());
        return userConsumeDetailMapper.updateUserConsumeDetail(userConsumeDetail);
    }

    /**
     * 批量删除消费记录
     * 
     * @param ids 需要删除的消费记录主键
     * @return 结果
     */
    @Override
    public int deleteUserConsumeDetailByIds(Long[] ids)
    {
        return userConsumeDetailMapper.deleteUserConsumeDetailByIds(ids);
    }

    /**
     * 删除消费记录信息
     * 
     * @param id 消费记录主键
     * @return 结果
     */
    @Override
    public int deleteUserConsumeDetailById(Long id)
    {
        return userConsumeDetailMapper.deleteUserConsumeDetailById(id);
    }
}
